geometrical mean python

35

import numpy as np

def geo_mean(iterable):
    a = np.array(iterable)
    return a.prod()**(1.0/len(a))

Comments

Submit
0 Comments